<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ page isELIgnored="false" %>

<html>
<head>
	<title>ALL PROPERTIES</title>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/resources/css/navbar.css" media="screen" />
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/resources/css/properties.css" media="screen" />
</head>

<body>

	<div id="navbar">
		<ul>
			<li><a href="${pageContext.request.contextPath}/viewAll">Home</a></li>
			<li><a href="${pageContext.request.contextPath}/createPropertyForm">Create</a></li>
		</ul>
	</div>
	
	<hr />

	<table id="properties">
	
		<thead>
			<tr>
				<th />
				<th scope="col">Name</th>
				<th scope="col">Value</th>
				<th scope="col">Tags</th>
			</tr>
		</thead>
	
	
		<tbody>
			<c:forEach items="${properties}" var="Property" varStatus="i" begin="0">
				<form:form action="editPropertyForm" method="get">
					<input type="hidden" name="id" value="${Property.id}" />
					
					<tr class="property">
						<td><input type="submit" class="button primary" value="edit" /></td>
						<td class="property">${Property.name}</td>
						<td class="property">${Property.value}</td>
						<td class="property">${Property.tagNames}</td>
					</tr>
							
				</form:form>
			</c:forEach>
		</tbody>
		
	</table>
	
	<br>
</body>
